const express = require('express');

const expressJoi = require('@escook/express-joi');

const {update_password_schema,add_account_schema} = require('../schema/userinfo');

const router = express.Router();

const userinfo_handler = require('../router-handler/userinfo');

// 获取用户信息路由
router.get('/userinfo',userinfo_handler.getUserInfo);

// 更新用户密码路由
router.put('/updatepwd',expressJoi(update_password_schema),userinfo_handler.updatePassword);

// 添加用户账号路由
router.post('/addaccount',expressJoi(add_account_schema),userinfo_handler.addAccount);

// 退出登录路由
router.post('/logout',userinfo_handler.logout)

module.exports = router